﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HATerrain
{
    [Serializable]
    public class TerrainData
    {
        public TerrainData()
        {
            //this._data = null;
            this._data2D = null;
        }


        //数据
        //private double[] _data;

        private dynamic _data2D;

        private TerrainHeader _header = new TerrainHeader();

        public TerrainHeader Header
        {
            get { return _header; }
            set { _header = value; }
        }


        //public double[] Data
        //{
        //    get { return _data; }
        //    set { _data = value; }
        //}


        public dynamic Data2D
        {
            get { return _data2D; }
            set { _data2D = value; }
        }



        public static void Save(string filename,TerrainData td)
        {
            bool b = FileHelper.SaveToBinary(filename, td);
        }


        public static TerrainData Open(string filename)
        {
            bool b = false;

            TerrainData td;

            td = FileHelper.OpenFromBinary(filename, ref b) as TerrainData;

            if (b == true)
            {
                return td;
            }
            else
            {
                return null;
            }
        }



    }
}
